import React from "react";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import FormQueryScreen from "../screens/user/formQuery";
import PhotoingScreen from "../screens/user/photoingScreen";
import FormScreen from "../screens/user/formScreen";
import GoodsCheckScreen from "../screens/user/goodsCheckScreen";
import SameComGoods from "../screens/user/sameComGoods";
import DetialScreen from "../screens/user/detialScreen";
import { FormProvider } from "../context/user/formContext";
import { FormQueryProvider } from "../context/user/formQueryContext";
import { MaterialProvider } from "../context/suppiler/materialContext";
import { GoodsCheckProvider } from "../context/user/goodsCkeckContext";

const Stack = createNativeStackNavigator();

const UserFormNavigation = () => {
  return (
    <GoodsCheckProvider>
      {/* <MaterialProvider> */}
      <FormProvider>
        <FormQueryProvider>
          <Stack.Navigator initialRouteName="Photoing">
            <Stack.Screen
              name="Photoing"
              component={PhotoingScreen}
              options={{ title: "拍照识别" }}
            />
            <Stack.Screen
              name="Form"
              component={FormScreen}
              options={{ title: "数据检查" }}
            />
            <Stack.Screen
              name="FormQuery"
              component={FormQueryScreen}
              options={{ headerShown: false }}
            />
            <Stack.Screen
              name="GoodsCheckQuery"
              component={GoodsCheckScreen}
              options={{ headerShown: false }}
            />
            <Stack.Screen
              name="SameComGoods"
              component={SameComGoods}
              options={({ route }) => ({
                title: route.params.title,
                // headerStyle: {
                //   // backgroundColor: "#F2F2F2",
                //   fontSize: 15,
                // },
              })}
            />
            <Stack.Screen
              name="GoodsDetail"
              component={DetialScreen}
              options={{ headerShown: false }}
            />
          </Stack.Navigator>
        </FormQueryProvider>
      </FormProvider>
      {/* </MaterialProvider> */}
    </GoodsCheckProvider>
  );
};

export default UserFormNavigation;
